<!doctype html>



  


<html class="theme-next muse use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  
    
      
    

    
  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Microsoft YaHei:300,300italic,400,400italic,700,700italic|consolas:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="jQuery,库," />








  <link rel="shortcut icon" type="image/x-icon" href="http://ofy7k3v4s.bkt.clouddn.com/mylogo.png?v=5.0.2" />






<meta name="description" content="&amp;#x4F7F;&amp;#x7528; CSS &amp;#x9009;&amp;#x62E9;&amp;#x5668;&amp;#x6765;&amp;#x8BC6;&amp;#x522B;&amp;#x4E00;&amp;#x7EC4;&amp;#x6587;&amp;#x6863;&amp;#x5143;&amp;#x7D20;&amp;#xFF0C;&amp;#x5E76;&amp;#x8FD4;&amp;#x56DE;&amp;#x4E00;&amp;#x4E2A;&amp;#x5BF9;&amp;#x8C61;&amp;#x8868;&amp;#x793A;&amp;#x">
<meta property="og:type" content="article">
<meta property="og:title" content="jQuery">
<meta property="og:url" content="https://hongqinma.github.io/2014/12/05/21-jQuery/index.html">
<meta property="og:site_name" content="HongqinMa' Blog">
<meta property="og:description" content="&amp;#x4F7F;&amp;#x7528; CSS &amp;#x9009;&amp;#x62E9;&amp;#x5668;&amp;#x6765;&amp;#x8BC6;&amp;#x522B;&amp;#x4E00;&amp;#x7EC4;&amp;#x6587;&amp;#x6863;&amp;#x5143;&amp;#x7D20;&amp;#xFF0C;&amp;#x5E76;&amp;#x8FD4;&amp;#x56DE;&amp;#x4E00;&amp;#x4E2A;&amp;#x5BF9;&amp;#x8C61;&amp;#x8868;&amp;#x793A;&amp;#x">
<meta property="og:updated_time" content="2016-11-30T10:08:02.747Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="jQuery">
<meta name="twitter:description" content="&amp;#x4F7F;&amp;#x7528; CSS &amp;#x9009;&amp;#x62E9;&amp;#x5668;&amp;#x6765;&amp;#x8BC6;&amp;#x522B;&amp;#x4E00;&amp;#x7EC4;&amp;#x6587;&amp;#x6863;&amp;#x5143;&amp;#x7D20;&amp;#xFF0C;&amp;#x5E76;&amp;#x8FD4;&amp;#x56DE;&amp;#x4E00;&amp;#x4E2A;&amp;#x5BF9;&amp;#x8C61;&amp;#x8868;&amp;#x793A;&amp;#x">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '6347850919329138000',
      author: 'Hiraku'
    }
  };
</script>




  <link rel="canonical" href="https://hongqinma.github.io/2014/12/05/21-jQuery/"/>


  <title> jQuery | HongqinMa' Blog </title>
</head>

<body itemscope itemtype="//schema.org/WebPage" lang="en">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?10010323";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="//schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta custom-logo">
  
    <div class="site-meta-headline">
      <a>
        <img class="custom-logo-image" src="http://ofy7k3v4s.bkt.clouddn.com/photo.jpg"
             alt="HongqinMa' Blog"/>
      </a>
    </div>
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">HongqinMa' Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">Spell at all costs， to rush you in the future。</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                jQuery
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-12-05T22:41:02+08:00" content="2014-12-05">
              2014-12-05
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/jQuery/" itemprop="url" rel="index">
                    <span itemprop="name">jQuery</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/12/05/21-jQuery/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/12/05/21-jQuery/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          
              &nbsp; | &nbsp;
              <span class="page-pv"><i class="fa fa-file-o"></i>
              <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
              </span>
          

          
            <span id="busuanzi_container_page_pv">  <span id="busuanzi_value_page_pv"></span> Views</span>
          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>&#x4F7F;&#x7528; CSS &#x9009;&#x62E9;&#x5668;&#x6765;&#x8BC6;&#x522B;&#x4E00;&#x7EC4;&#x6587;&#x6863;&#x5143;&#x7D20;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x8868;&#x793A;&#x8FD9;&#x4E9B;&#x5143;&#x7D20;&#x3002;&#x8FD4;&#x56DE;&#x7684;&#x5BF9;&#x8C61;&#x63D0;&#x4F9B;&#x4E86;&#x5927;&#x91CF;&#x7684;&#x65B9;&#x6CD5;&#x6765;&#x6279;&#x91CF;&#x64CD;&#x4F5C;&#x5339;&#x914D;&#x7684;&#x5143;&#x7D20;&#x3002;</p>
<h2 id="jQuery&#x524D;&#x620F;"><a href="#jQuery&#x524D;&#x620F;" class="headerlink" title="jQuery&#x524D;&#x620F;"></a>jQuery&#x524D;&#x620F;</h2><h3 id="js&#x4E0D;&#x8DB3;"><a href="#js&#x4E0D;&#x8DB3;" class="headerlink" title="js&#x4E0D;&#x8DB3;"></a>js&#x4E0D;&#x8DB3;</h3><ul>
<li>&#x4EE3;&#x7801;&#x5F88;&#x9EBB;&#x70E6;&#xFF0C;&#x5197;&#x4F59;</li>
<li>&#x6D4F;&#x89C8;&#x5668;&#x517C;&#x5BB9;&#x6027;&#x95EE;&#x9898;</li>
<li>&#x5165;&#x53E3;&#x51FD;&#x6570;&#x53EA;&#x80FD;&#x5199;&#x4E00;&#x4E2A;&#xFF0C;&#x5199;&#x4E86;&#x591A;&#x4E2A;&#xFF0C;&#x540E;&#x9762;&#x7684;&#x4F1A;&#x8986;&#x76D6;&#x524D;&#x9762;&#x7684;&#x95EE;&#x9898;</li>
<li>js&#x7684;&#x4EE3;&#x7801;&#x5BB9;&#x9519;&#x6027;&#x6BD4;&#x8F83;&#x5DEE;&#xFF08;&#x6BD4;&#x8F83;&#x5BB9;&#x6613;&#x51FA;&#x9519;&#xFF09;</li>
<li>&#x5B9E;&#x73B0;&#x4E00;&#x4E9B;&#x7B80;&#x5355;&#x7684;&#x52A8;&#x753B;&#x6BD4;&#x8F83;&#x9EBB;&#x70E6;</li>
</ul>
<h3 id="&#x4EC0;&#x4E48;&#x662F;jquery&#xFF1F;"><a href="#&#x4EC0;&#x4E48;&#x662F;jquery&#xFF1F;" class="headerlink" title="&#x4EC0;&#x4E48;&#x662F;jquery&#xFF1F;"></a>&#x4EC0;&#x4E48;&#x662F;jquery&#xFF1F;</h3><p>jquery&#x662F;&#x4E00;&#x4E2A;js&#x5E93;&#x3002;jquery&#x5C31;&#x662F;&#x4E00;&#x4E2A;js&#x6587;&#x4EF6;.</p>
<p>&#x4EC0;&#x4E48;&#x662F;js&#x5E93;&#xFF1F;js&#x5E93;&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x628A;&#x4E00;&#x4E9B;&#x6211;&#x4EEC;&#x5E38;&#x7528;&#x5230;&#x7684;&#x65B9;&#x6CD5;&#x5C01;&#x88C5;&#x5230;&#x4E00;&#x4E2A;&#x5355;&#x72EC;&#x7684;js&#x6587;&#x4EF6;&#x91CC;&#x9762;&#xFF0C;&#x5F53;&#x6211;&#x4EEC;&#x60F3;&#x7528;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5F15;&#x5165;&#x5B83;&#x3002;&#xFF08;common.js  animate.js&#xFF09;</p>
<p>&#x7279;&#x70B9;&#xFF1A;</p>
<ul>
<li>&#x4E30;&#x5BCC;&#x5F3A;&#x5927;&#x7684;&#x8BED;&#x6CD5;</li>
<li>&#x9AD8;&#x6548;&#x7684;&#x67E5;&#x8BE2;</li>
<li>&#x4E00;&#x5957;&#x6709;&#x7528;&#x7684;&#x65B9;&#x6CD5;</li>
<li>&#x5F3A;&#x5927;&#x7684;&#x51FD;&#x6570;&#x5F0F;&#x7F16;&#x7A0B;&#x6280;&#x5DE7;&#xFF0C;&#x6279;&#x91CF;&#x64CD;&#x4F5C;&#x5143;&#x7D20;&#x96C6;</li>
<li>&#x7B80;&#x6D01;&#x7684;&#x8BED;&#x8A00;&#x7528;&#x6CD5;</li>
</ul>
<h3 id="&#x5F15;&#x5305;"><a href="#&#x5F15;&#x5305;" class="headerlink" title="&#x5F15;&#x5305;"></a>&#x5F15;&#x5305;</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;jquery-1.12.4.js&quot;</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<h2 id="&#x5168;&#x5C40;&#x51FD;&#x6570;"><a href="#&#x5168;&#x5C40;&#x51FD;&#x6570;" class="headerlink" title="&#x5168;&#x5C40;&#x51FD;&#x6570;"></a>&#x5168;&#x5C40;&#x51FD;&#x6570;</h2><p><code>jQuery()</code> &#x5168;&#x5C40;&#x51FD;&#x6570;&#xFF0C;&#x5BF9;&#x5E94;&#x4E8E;&#x4E00;&#x4E2A;&#x5FEB;&#x6377;&#x540D;&#xFF1A;<code>$</code>&#x3002;<code>jQuery()</code> &#x662F;&#x5DE5;&#x5382;&#x51FD;&#x6570;&#xFF0C;&#x4E0D;&#x4F7F;&#x7528; <code>new</code> &#x5173;&#x952E;&#x5B57;&#x3002;</p>
<h3 id="&#x5165;&#x53E3;&#x51FD;&#x6570;"><a href="#&#x5165;&#x53E3;&#x51FD;&#x6570;" class="headerlink" title="&#x5165;&#x53E3;&#x51FD;&#x6570;"></a>&#x5165;&#x53E3;&#x51FD;&#x6570;</h3><h4 id="js&#x5165;&#x53E3;&#x51FD;&#x6570;"><a href="#js&#x5165;&#x53E3;&#x51FD;&#x6570;" class="headerlink" title="js&#x5165;&#x53E3;&#x51FD;&#x6570;"></a>js&#x5165;&#x53E3;&#x51FD;&#x6570;</h4><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">window</span>.onload = <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{...};</div></pre></td></tr></table></figure>
<h4 id="jQuery&#x5165;&#x53E3;&#x51FD;&#x6570;1"><a href="#jQuery&#x5165;&#x53E3;&#x51FD;&#x6570;1" class="headerlink" title="jQuery&#x5165;&#x53E3;&#x51FD;&#x6570;1"></a>jQuery&#x5165;&#x53E3;&#x51FD;&#x6570;1</h4><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$(<span class="built_in">document</span>).ready(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{...});</div></pre></td></tr></table></figure>
<h4 id="jQuery&#x5165;&#x53E3;&#x51FD;&#x6570;2&#xFF08;&#x7B80;&#x5316;&#xFF09;"><a href="#jQuery&#x5165;&#x53E3;&#x51FD;&#x6570;2&#xFF08;&#x7B80;&#x5316;&#xFF09;" class="headerlink" title="jQuery&#x5165;&#x53E3;&#x51FD;&#x6570;2&#xFF08;&#x7B80;&#x5316;&#xFF09;"></a>jQuery&#x5165;&#x53E3;&#x51FD;&#x6570;2&#xFF08;&#x7B80;&#x5316;&#xFF09;</h4><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{...});</div></pre></td></tr></table></figure>
<h3 id="&#x7B26;&#x5B9E;&#x8D28;"><a href="#&#x7B26;&#x5B9E;&#x8D28;" class="headerlink" title="$&#x7B26;&#x5B9E;&#x8D28;"></a>$&#x7B26;&#x5B9E;&#x8D28;</h3><ul>
<li>$&#x5B9E;&#x8D28;&#x662F;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#xFF0C;jQuery &#x5BF9;&#x8C61;&#x662F;&#x7C7B;&#x6570;&#x7EC4;&#x5BF9;&#x8C61;&#x3002;</li>
<li>&#x53C2;&#x6570;&#x662F; <code>function</code> &#x3001;&#x628A; <code>dom</code> &#x5143;&#x7D20; <code>document</code> &#x8F6C;&#x6210; <code>jQuery</code> &#x5BF9;&#x8C61;&#xFF0C;&#x9009;&#x62E9;&#x5668;</li>
</ul>
<blockquote>
<p>jQuery &#x7684;&#x8C03;&#x7528;&#x65B9;&#x5F0F;</p>
</blockquote>
<p>&#x7B2C;&#x4E00;&#x79CD;&#xFF1A;&#x4F20;&#x9012; CSS &#x9009;&#x62E9;&#x5668;&#xFF08;&#x5B57;&#x7B26;&#x4E32;&#xFF09;&#x7ED9; <code>$()</code> &#x65B9;&#x6CD5;&#x3002; &#x9009;&#x62E9;&#x5668;&#x652F;&#x6301;&#x5927;&#x90E8;&#x5206; CSS3 &#x9009;&#x62E9;&#x5668;&#xFF0C;&#x4E5F;&#x6709;&#x81EA;&#x5DF1;&#x6269;&#x5C55;&#x7684;&#x3002;&#x8FD4;&#x56DE;&#x5F53;&#x524D;&#x6587;&#x6863;&#x4E2D;&#x5339;&#x914D;&#x8BE5;&#x9009;&#x62E9;&#x5668;&#x7684;&#x5143;&#x7D20;&#x96C6;&#x5408;&#x3002;&#x8FD8;&#x53EF;&#x4EE5;&#x5C06;&#x4E00;&#x4E2A; jQuery &#x5BF9;&#x8C61;&#x4F5C;&#x4E3A;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x4F20;&#x9012;&#x7ED9; <code>$()</code> &#x65B9;&#x6CD5;&#xFF0C;&#x8FD4;&#x56DE;&#x8BE5;&#x7279;&#x5B9A;&#x5143;&#x7D20;&#x6216;&#x5143;&#x7D20;&#x5B50;&#x5143;&#x7D20;&#x4E2D;&#x5339;&#x914D;&#x9009;&#x62E9;&#x5668;&#x7684;&#x90E8;&#x5206;&#x3002;&#x7B2C;&#x4E8C;&#x4E2A;&#x5143;&#x7D20;&#x53EF;&#x9009;&#x7684;&#x3002;</p>
<p>&#x7B2C;&#x4E8C;&#x79CD;&#xFF1A;&#x4F20;&#x9012;&#x4E00;&#x4E2A; Element&#x3001;Document &#x6216; Window &#x5BF9;&#x8C61;&#x7ED9; <code>$()</code> &#x65B9;&#x6CD5;&#x3002;&#x5C06;&#x4F20;&#x5165;&#x7684;&#x5185;&#x5BB9;&#x5C01;&#x88C5;&#x6210; jQuery &#x5BF9;&#x8C61;&#x3002;</p>
<p>&#x7B2C;&#x4E09;&#x79CD;&#xFF1A;&#x4F20;&#x9012; HTML &#x6587;&#x672C;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x4F1A;&#x6839;&#x636E;&#x4F20;&#x5165;&#x7684;&#x6587;&#x672C;&#x521B;&#x5EFA;&#x597D; HTML &#x5143;&#x7D20;&#x5E76;&#x5C01;&#x88C5;&#x4E3A; jQuery &#x5BF9;&#x8C61;&#x8FD4;&#x56DE;&#x3002;&#x53EF;&#x4EE5;&#x63A5;&#x6536;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x53EF;&#x4EE5;&#x4F20;&#x9012; Document &#x5BF9;&#x8C61;&#x6765;&#x6307;&#x5B9A;&#x4E0E;&#x6240;&#x521B;&#x5EFA;&#x5143;&#x7D20;&#x76F8;&#x5173;&#x8054;&#x7684;&#x6587;&#x6863;&#x3002;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x8FD8;&#x53EF;&#x4EE5;&#x662F; object &#x5BF9;&#x8C61;&#x3002;</p>
<p>&#x7B2C;&#x56DB;&#x4E2D;&#xFF1A;&#x4F20;&#x5165;&#x51FD;&#x6570;&#x3002;</p>
<hr>
<h2 id="&#x4E00;&#x4E9B;&#x57FA;&#x7840;&#x65B9;&#x6CD5;"><a href="#&#x4E00;&#x4E9B;&#x57FA;&#x7840;&#x65B9;&#x6CD5;" class="headerlink" title="&#x4E00;&#x4E9B;&#x57FA;&#x7840;&#x65B9;&#x6CD5;"></a>&#x4E00;&#x4E9B;&#x57FA;&#x7840;&#x65B9;&#x6CD5;</h2><ul>
<li><code>size()</code> &#x4EE3;&#x66FF; <code>length</code></li>
<li><code>get()</code> &#x4EE3;&#x66FF;&#x65B9;&#x62EC;&#x53F7;&#x7D22;&#x5F15;</li>
<li><code>toArray()</code> &#x5C06; <code>jQuery</code> &#x5BF9;&#x8C61;&#x8F6C;&#x6210;&#x771F;&#x6B63;&#x6570;&#x7EC4;</li>
<li><code>each()</code> &#x904D;&#x5386;&#xFF0C;&#x4EE3;&#x66FF; for &#x5FAA;&#x73AF;<ul>
<li>&#x53C2;&#x6570;&#x662F;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#xFF0C;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x4E2D;&#x7684; this &#x6307;&#x5411;&#x904D;&#x5386;&#x7684;&#x5143;&#x7D20;&#xFF0C;&#x662F;&#x539F;&#x751F;&#x7684; DOM &#x5BF9;&#x8C61;&#x3002;</li>
<li>&#x8FD8;&#x53EF;&#x4EE5;&#x5C06;&#x7D22;&#x5F15;&#xFF0C;&#x8BE5;&#x5143;&#x7D20;&#x4F20;&#x9012;&#x7ED9;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x548C;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x4E5F;&#x662F; DOM &#x5BF9;&#x8C61;&#x3002;</li>
<li>&#x8FD4;&#x56DE;&#x8C03;&#x7528;&#x81EA;&#x8EAB;&#x7684; jQuery &#x5BF9;&#x8C61;&#xFF0C;&#x53EF;&#x4EE5;&#x7528;&#x4E8E;&#x94FE;&#x5F0F;&#x7F16;&#x7A0B;</li>
</ul>
</li>
<li><code>map()</code> &#x548C; <code>Array.prototype.map()</code> &#x65B9;&#x6CD5;&#x5F88;&#x63A5;&#x8FD1;&#x3002;<ul>
<li>&#x63A5;&#x6536;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x4F5C;&#x4E3A;&#x53C2;&#x6570;&#xFF1B;</li>
<li>&#x7D22;&#x5F15;&#x662F;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x5143;&#x7D20;&#x4F5C;&#x4E3A; this &#x503C;&#x548C;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x7684;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x3002;</li>
<li>&#x5982;&#x679C;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x8FD4;&#x56DE; null &#x6216; undefined&#xFF0C;&#x7D22;&#x5F15;&#x5FFD;&#x7565;&#x3002;</li>
<li>&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x6216;&#x8005;&#x4F2A;&#x6570;&#x7EC4;</li>
<li>map() &#x8FD4;&#x56DE;&#x7684; jQuery &#x5BF9;&#x8C61;&#x53EF;&#x4EE5;&#x4E0D;&#x5305;&#x62EC;&#x6587;&#x6863;&#x5143;&#x7D20;&#xFF0C;&#x4F46;&#x4F9D;&#x65E7;&#x53EF;&#x4EE5;&#x50CF;&#x4F2A;&#x6570;&#x7EC4;&#x5BF9;&#x8C61;&#x4E00;&#x6837;&#x4F7F;&#x7528;&#x3002;</li>
</ul>
</li>
<li><code>index()</code> &#x63A5;&#x6536;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x8FD4;&#x56DE;&#x8BE5;&#x5143;&#x7D20;&#x5728; jQuery &#x5BF9;&#x8C61;&#x4E2D;&#x7684;&#x7D22;&#x5F15;&#x503C;&#x3002;&#x627E;&#x4E0D;&#x5230;&#x8FD4;&#x56DE; -1.</li>
<li><code>is()</code> &#x63A5;&#x6536;&#x4E00;&#x4E2A;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x9009;&#x4E2D;&#x5143;&#x7D20;&#x81F3;&#x5C11;&#x6709;&#x4E00;&#x4E2A;&#x5339;&#x914D;&#x8BE5;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x8FD4;&#x56DE; true&#x3002;</li>
</ul>
<p>jQuery &#x5BF9;&#x8C61;&#x7684;&#x4E09;&#x4E2A;&#x5C5E;&#x6027;</p>
<ul>
<li><code>selector</code> &#x9009;&#x62E9;&#x5668;&#x5B57;&#x7B26;&#x4E32;</li>
<li><code>context</code> &#x4F20;&#x9012;&#x7ED9; <code>$()</code> &#x7684;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;</li>
<li><code>jquery</code> jQuery &#x7684;&#x7248;&#x672C;&#x53F7;</li>
</ul>
<h2 id="&#x9009;&#x62E9;&#x5668;"><a href="#&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x9009;&#x62E9;&#x5668;"></a>&#x9009;&#x62E9;&#x5668;</h2><h3 id="&#x57FA;&#x672C;&#x9009;&#x62E9;&#x5668;"><a href="#&#x57FA;&#x672C;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x57FA;&#x672C;&#x9009;&#x62E9;&#x5668;"></a>&#x57FA;&#x672C;&#x9009;&#x62E9;&#x5668;</h3><ul>
<li>ID&#x9009;&#x62E9;&#x5668; <code>$(&quot;#id&#x540D;&quot;);</code></li>
<li>&#x7C7B;&#x9009;&#x62E9;&#x5668; <code>$(&quot;.&#x7C7B;&#x540D;&quot;);</code></li>
<li>&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668; <code>$(&quot;&#x6807;&#x7B7E;&#x540D;&quot;);</code></li>
<li>&#x5E76;&#x96C6;&#x9009;&#x62E9;&#x5668; <code>$(&quot;#curr,.cls&quot;);</code></li>
<li>&#x4EA4;&#x96C6;&#x9009;&#x62E9;&#x5668; <code>$(&quot;li.cls&quot;);</code></li>
</ul>
<h3 id="&#x5C42;&#x7EA7;&#x9009;&#x62E9;&#x5668;"><a href="#&#x5C42;&#x7EA7;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x5C42;&#x7EA7;&#x9009;&#x62E9;&#x5668;"></a>&#x5C42;&#x7EA7;&#x9009;&#x62E9;&#x5668;</h3><ul>
<li>&#x5B50;&#x4EE3;&#x9009;&#x62E9;&#x5668; <code>$(&quot;#curr&gt;.cls&quot;)</code></li>
<li>&#x540E;&#x4EE3;&#x9009;&#x62E9;&#x5668; <code>$(&quot;li cls&quot;)</code></li>
</ul>
<h3 id="&#x8FC7;&#x6EE4;&#x9009;&#x62E9;&#x5668;"><a href="#&#x8FC7;&#x6EE4;&#x9009;&#x62E9;&#x5668;" class="headerlink" title="&#x8FC7;&#x6EE4;&#x9009;&#x62E9;&#x5668;"></a>&#x8FC7;&#x6EE4;&#x9009;&#x62E9;&#x5668;</h3><ul>
<li><code>:odd;</code></li>
<li><code>:even;</code></li>
<li><code>:eq(0);</code><ul>
<li><em>jQuery&#x5BF9;&#x8C61;</em></li>
</ul>
</li>
</ul>
<h3 id="&#x65B9;&#x6CD5;"><a href="#&#x65B9;&#x6CD5;" class="headerlink" title="&#x65B9;&#x6CD5;"></a>&#x65B9;&#x6CD5;</h3><ul>
<li><code>$(this).css(&quot;backgroundColor&quot;, &quot;pink&quot;).siblings(&quot;li&quot;).css(&quot;backgroundColor&quot;, &quot;&quot;);</code><ul>
<li><em>&#x94FE;&#x5F0F;&#x7F16;&#x7A0B;</em></li>
</ul>
</li>
<li><code>$(this).find(&quot;li&quot;).css(&quot;backgroundColor&quot;, &quot;&quot;);</code></li>
<li><code>css({});</code><ul>
<li><em>css&#x8BBE;&#x7F6E;&#x6837;&#x5F0F;</em></li>
</ul>
</li>
<li><code>siblings();</code><ul>
<li><em>&#x5144;&#x5F1F;&#x5143;&#x7D20;</em></li>
</ul>
</li>
<li><code>find();</code><ul>
<li><em>&#x540E;&#x4EE3;&#x5143;&#x7D20;</em></li>
</ul>
</li>
<li><code>next();</code><ul>
<li><em>&#x4E0B;&#x4E00;&#x4E2A;&#x5144;&#x5F1F;&#x5143;&#x7D20;</em></li>
</ul>
</li>
<li><code>parent();</code><ul>
<li><em>&#x7236;&#x5143;&#x7D20;</em></li>
</ul>
</li>
<li><code>show();</code><ul>
<li><em>&#x663E;&#x793A;</em></li>
</ul>
</li>
<li><code>hide();</code><ul>
<li><em>&#x5F71;&#x85CF;</em></li>
</ul>
</li>
<li><code>index();</code><ul>
<li><em>&#x83B7;&#x53D6;&#x7684;&#x662F;&#x5F53;&#x524D;&#x5BF9;&#x8C61;&#x5728;&#x5B83;&#x5144;&#x5F1F;&#x91CC;&#x9762;&#x7684;&#x7D22;&#x5F15;</em>/</li>
</ul>
</li>
<li>`eq(0);<ul>
<li><em>&#x53D6;&#x5230;&#x7684;&#x662F;jQuery&#x5BF9;&#x8C61;</em></li>
</ul>
</li>
</ul>
<hr>
<h2 id="&#x9690;&#x5F0F;&#x8FED;&#x4EE3;"><a href="#&#x9690;&#x5F0F;&#x8FED;&#x4EE3;" class="headerlink" title="&#x9690;&#x5F0F;&#x8FED;&#x4EE3;"></a>&#x9690;&#x5F0F;&#x8FED;&#x4EE3;</h2><ul>
<li>&#x8BBE;&#x7F6E;&#x5C5E;&#x6027;&#x7684;&#x64CD;&#x4F5C;&#x7684;&#x65F6;&#x5019;&#x8BBE;&#x7F6E;&#x7684;&#x662F;&#x6240;&#x6709;&#x7684;&#x5143;&#x7D20;</li>
<li>&#x83B7;&#x53D6;&#x6027;&#x64CD;&#x4F5C;&#x4E0D;&#x53BB;&#x904D;&#x5386;&#xFF0C;&#x76F4;&#x63A5;&#x83B7;&#x53D6;&#x7B2C;&#x4E00;&#x4E2A;</li>
</ul>
<hr>
<h2 id="&#x7C7B;&#x64CD;&#x4F5C;"><a href="#&#x7C7B;&#x64CD;&#x4F5C;" class="headerlink" title="&#x7C7B;&#x64CD;&#x4F5C;"></a>&#x7C7B;&#x64CD;&#x4F5C;</h2><ul>
<li>&#x6DFB;&#x52A0;&#x7C7B; <code>addClass();</code> <ul>
<li><em>&#x7C7B;&#x540D;</em></li>
</ul>
</li>
<li>&#x79FB;&#x9664;&#x7C7B; <code>removeClass();</code><ul>
<li><em>&#x7C7B;&#x540D;</em></li>
</ul>
</li>
<li>&#x5224;&#x65AD;&#x7C7B; <code>hasClass();</code><ul>
<li><em>&#x7C7B;&#x540D;</em></li>
</ul>
</li>
<li>&#x5207;&#x6362; <code>toggle();</code><ul>
<li><em>&#x7C7B;&#x540D;&#xFF0C;&#x4E24;&#x4E2A;&#x7C7B;&#x540D;&#x4E4B;&#x95F4;&#x5207;&#x6362;&#x64CD;&#x4F5C;</em></li>
</ul>
</li>
</ul>
<hr>
<h2 id="&#x52A8;&#x753B;"><a href="#&#x52A8;&#x753B;" class="headerlink" title="&#x52A8;&#x753B;"></a>&#x52A8;&#x753B;</h2><p>###&#x663E;&#x793A;&#x3001;&#x9690;&#x85CF;</p>
<ul>
<li>show();  hide();  toggle(); <ul>
<li><em>&#x53C2;&#x6570;speed,&#x503C;&#x4E3A;&#x6BEB;&#x79D2;&#x503C;</em></li>
</ul>
</li>
</ul>
<h3 id="&#x6DE1;&#x5165;&#x3001;&#x6DE1;&#x51FA;"><a href="#&#x6DE1;&#x5165;&#x3001;&#x6DE1;&#x51FA;" class="headerlink" title="&#x6DE1;&#x5165;&#x3001;&#x6DE1;&#x51FA;"></a>&#x6DE1;&#x5165;&#x3001;&#x6DE1;&#x51FA;</h3><ul>
<li>fadeIn();  fadeIn(); fadeToggle()&#xFF1B; <ul>
<li><em>&#x4E0D;&#x4F20;&#x53C2;&#x6570;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6709;&#x52A8;&#x753B;&#xFF0C;normal;</em></li>
</ul>
</li>
</ul>
<h3 id="&#x6ED1;&#x5165;&#x3001;&#x6ED1;&#x51FA;"><a href="#&#x6ED1;&#x5165;&#x3001;&#x6ED1;&#x51FA;" class="headerlink" title="&#x6ED1;&#x5165;&#x3001;&#x6ED1;&#x51FA;"></a>&#x6ED1;&#x5165;&#x3001;&#x6ED1;&#x51FA;</h3><ul>
<li>slideUp();  slideUp(); slideToggle()&#xFF1B;<ul>
<li><em>&#x4E0D;&#x4F20;&#x53C2;&#x6570;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6709;&#x52A8;&#x753B;&#xFF0C;normal;</em></li>
</ul>
</li>
</ul>
<h3 id="&#x81EA;&#x5B9A;&#x4E49;&#x52A8;&#x753B;"><a href="#&#x81EA;&#x5B9A;&#x4E49;&#x52A8;&#x753B;" class="headerlink" title="&#x81EA;&#x5B9A;&#x4E49;&#x52A8;&#x753B;"></a>&#x81EA;&#x5B9A;&#x4E49;&#x52A8;&#x753B;</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$(<span class="string">&quot;#box&quot;</span>).animate({<span class="string">&quot;width&quot;</span>:<span class="string">&quot;400px&quot;</span>,<span class="string">&quot;height&quot;</span>:<span class="string">&quot;400px&quot;</span>, <span class="string">&quot;left&quot;</span>:<span class="string">&quot;400px&quot;</span>},speed,easing);</div></pre></td></tr></table></figure>
<h3 id="&#x505C;&#x6B62;&#x52A8;&#x753B;-stop"><a href="#&#x505C;&#x6B62;&#x52A8;&#x753B;-stop" class="headerlink" title="&#x505C;&#x6B62;&#x52A8;&#x753B; stop();"></a>&#x505C;&#x6B62;&#x52A8;&#x753B; <code>stop();</code></h3><ul>
<li>stop(clearQueue, jumpToEnd);<ul>
<li><em>&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x5426;&#x6E05;&#x9664;&#x52A8;&#x753B;&#x961F;&#x5217; true, false&#xFF0C;&#x9ED8;&#x8BA4;false;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x662F;&#x5426;&#x8DF3;&#x8F6C;&#x5230;&#x5F53;&#x524D;&#x52A8;&#x753B;&#x7684;&#x6700;&#x7EC8;&#x6548;&#x679C; true, false</em></li>
</ul>
</li>
</ul>
<hr>
<h2 id="jQuery&#x548C;js&#x8282;&#x70B9;&#x64CD;&#x4F5C;"><a href="#jQuery&#x548C;js&#x8282;&#x70B9;&#x64CD;&#x4F5C;" class="headerlink" title="jQuery&#x548C;js&#x8282;&#x70B9;&#x64CD;&#x4F5C;"></a>jQuery&#x548C;js&#x8282;&#x70B9;&#x64CD;&#x4F5C;</h2><h3 id="js&#x8282;&#x70B9;&#x64CD;&#x4F5C;"><a href="#js&#x8282;&#x70B9;&#x64CD;&#x4F5C;" class="headerlink" title="js&#x8282;&#x70B9;&#x64CD;&#x4F5C;"></a>js&#x8282;&#x70B9;&#x64CD;&#x4F5C;</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> box = <span class="built_in">document</span>.getElementById(<span class="string">&quot;box&quot;</span>);</div><div class="line">aNode.document.createElement(<span class="string">&quot;a&quot;</span>);</div><div class="line">box.appendChild(aNode);</div><div class="line">aNode.innerHTML = <span class="string">&quot;innerHtml&quot;</span>;</div></pre></td></tr></table></figure>
<h3 id="jQuery-&#x64CD;&#x4F5C;"><a href="#jQuery-&#x64CD;&#x4F5C;" class="headerlink" title="jQuery &#x64CD;&#x4F5C;"></a>jQuery &#x64CD;&#x4F5C;</h3><ul>
<li><code>append();</code><ul>
<li><em>&#x6DFB;&#x52A0;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>appendTo()</code><ul>
<li><em>&#x6DFB;&#x52A0;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>prepend();</code><ul>
<li><em>&#x6DFB;&#x52A0;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>prependTo()</code><ul>
<li><em>&#x6DFB;&#x52A0;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>after();</code><ul>
<li><em>&#x6DFB;&#x52A0;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>before();</code><ul>
<li><em>&#x6DFB;&#x52A0;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>insertAfter()</code><ul>
<li><em>&#x63D2;&#x5165;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>insertBefore()</code><ul>
<li><em>&#x63D2;&#x5165;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>replaceWith()</code><ul>
<li><em>&#x66FF;&#x6362;</em></li>
</ul>
</li>
<li><code>add()</code><ul>
<li><em>&#x6DFB;&#x52A0;</em></li>
</ul>
</li>
<li><code>first()</code><ul>
<li><em>&#x4EC5;&#x5305;&#x542B;&#x9009;&#x4E2D;&#x5143;&#x7D20;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;</em></li>
</ul>
</li>
<li><code>eq()</code><ul>
<li><em>&#x53EA;&#x5305;&#x542B;&#x6307;&#x5B9A;&#x5E8F;&#x53F7;&#x7684;&#x5355;&#x4E2A;&#x5143;&#x7D20;</em></li>
</ul>
</li>
<li><code>html();</code><ul>
<li><em>&#x4E0D;&#x4F20;&#x53C2;&#x83B7;&#x53D6;&#xFF0C;&#x4F20;&#x53C2;&#x8BBE;&#x7F6E;</em></li>
</ul>
</li>
<li><code>text();</code><ul>
<li><em>&#x4E0D;&#x4F20;&#x53C2;&#x83B7;&#x53D6;&#xFF0C;&#x4F20;&#x53C2;&#x8BBE;&#x7F6E;</em></li>
</ul>
</li>
<li><code>empty();</code><ul>
<li><em>&#x6E05;&#x7A7A;&#x8282;&#x70B9;&#xFF08;&#x6E05;&#x7406;&#x95E8;&#x6237;&#xFF09;</em></li>
</ul>
</li>
<li><code>remove();</code><ul>
<li><em>&#x5220;&#x9664;&#x8282;&#x70B9;&#xFF08;&#x81EA;&#x6740;&#xFF09;</em></li>
</ul>
</li>
<li><code>clone();</code><ul>
<li><em>&#x6DF1;&#x5EA6;&#x590D;&#x5236;&#xFF0C;&#x4E0D;&#x590D;&#x5236;&#x4E8B;&#x4EF6;</em></li>
</ul>
</li>
<li><code>clone(true);</code><ul>
<li><em>&#x6DF1;&#x5EA6;&#x590D;&#x5236;&#xFF0C;&#x5E76;&#x4E14;&#x590D;&#x5236;&#x4E8B;&#x4EF6;</em></li>
</ul>
</li>
<li><code>val();</code><ul>
<li><em>&#x83B7;&#x53D6;&#x503C;</em></li>
</ul>
</li>
<li><code>val(&quot;abc&quot;);</code><ul>
<li><em>&#x8BBE;&#x7F6E;&#x503C;</em></li>
</ul>
</li>
<li><code>next()</code><ul>
<li><em>&#x4E0B;&#x4E00;&#x4E2A;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>prev()</code><ul>
<li><em>&#x4E0A;&#x4E00;&#x4E2A;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>prevAll()</code><ul>
<li><em>&#x524D;&#x9762;&#x6240;&#x6709;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>nextAll()</code><ul>
<li><em>&#x540E;&#x9762;&#x6240;&#x6709;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>parent()</code><ul>
<li><em>&#x7236;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>sibling()</code><ul>
<li><em>&#x5144;&#x5F1F;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>find()</code><ul>
<li><em>&#x540E;&#x4EE3;&#x8282;&#x70B9;</em></li>
</ul>
</li>
<li><code>filer()</code><ul>
<li><em>&#x8FD4;&#x56DE;&#x7B26;&#x5408;&#x6761;&#x4EF6;&#x7684;jQuery&#x5BF9;&#x8C61;</em></li>
</ul>
</li>
<li><code>not()</code><ul>
<li><em>&#x6392;&#x9664;&#x5143;&#x7D20;</em></li>
</ul>
</li>
<li><code>has()</code><ul>
<li><em>&#x662F;&#x5426;&#x6709;</em></li>
</ul>
</li>
<li><code>gt()</code><ul>
<li><em>&#x53C2;&#x6570;&#x662F;&#x6570;&#x5B57;&#xFF0C;&#x8FD4;&#x56DE;&#x5927;&#x4E8E;&#x53C2;&#x6570;&#x7684;&#x540E;&#x9762;&#x7684;&#x5143;&#x7D20;</em></li>
</ul>
</li>
<li><code>wrap()</code><ul>
<li><em>&#x5305;&#x88C5;&#x6BCF;&#x4E00;&#x4E2A;</em></li>
</ul>
</li>
<li><code>wrapInner()</code><ul>
<li><em>&#x5305;&#x88C5;&#x6BCF;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x7684;&#x5185;&#x5BB9;</em></li>
</ul>
</li>
<li><code>wrapOuter()</code><ul>
<li><em>&#x5C06;&#x9009;&#x4E2D;&#x5143;&#x7D20;&#x4F5C;&#x4E3A;&#x4E00;&#x7EC4;&#x5305;&#x88C5;</em></li>
</ul>
</li>
</ul>
<h3 id="jQuery&#x5C5E;&#x6027;&#x64CD;&#x4F5C;"><a href="#jQuery&#x5C5E;&#x6027;&#x64CD;&#x4F5C;" class="headerlink" title="jQuery&#x5C5E;&#x6027;&#x64CD;&#x4F5C;"></a>jQuery&#x5C5E;&#x6027;&#x64CD;&#x4F5C;</h3><ul>
<li><code>setAttribute(&quot;target&quot;, &quot;_blank&quot;);</code></li>
<li><code>attr(&quot;title&quot;, &quot;&#x661F;&#x671F;&#x56DB;&quot;);</code><ul>
<li><em>&#x7528;&#x6CD5;&#x548C;css&#x7528;&#x6CD5;&#x662F;&#x4E00;&#x6837;</em></li>
</ul>
</li>
<li><code>attr(name, value);</code><ul>
<li><em>&#x7528;&#x6CD5;&#x548C;css&#x7528;&#x6CD5;&#x662F;&#x4E00;&#x6837;</em></li>
</ul>
</li>
<li><code>attr({json});</code><ul>
<li><em>&#x7528;&#x6CD5;&#x548C;css&#x7528;&#x6CD5;&#x662F;&#x4E00;&#x6837;</em></li>
</ul>
</li>
<li><code>css()</code><ul>
<li>&#x4F20;&#x5165;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#x53C2;&#x6570;&#xFF0C;&#x83B7;&#x53D6;&#x5BF9;&#x5E94;&#x6837;&#x5F0F;&#xFF0C;&#x6CE8;&#x610F;&#xFF0C;&#x4E0D;&#x80FD;&#x4F20;&#x5165;&#x590D;&#x5408;&#x6837;&#x5F0F;&#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x5982; &#x201C;font&#x201D;</li>
<li>&#x4F20;&#x5165;&#x4E24;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x8BBE;&#x7F6E;&#x6837;&#x5F0F;</li>
<li>&#x4F20;&#x5165;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x8BBE;&#x7F6E;&#x6837;&#x5F0F;</li>
</ul>
</li>
</ul>
<h3 id="jQuery&#x5C5E;&#x6027;&#x64CD;&#x4F5C;&#x7279;&#x4F8B;"><a href="#jQuery&#x5C5E;&#x6027;&#x64CD;&#x4F5C;&#x7279;&#x4F8B;" class="headerlink" title="jQuery&#x5C5E;&#x6027;&#x64CD;&#x4F5C;&#x7279;&#x4F8B;"></a>jQuery&#x5C5E;&#x6027;&#x64CD;&#x4F5C;&#x7279;&#x4F8B;</h3><p>&#x5E03;&#x5C14;&#x7C7B;&#x578B;&#x7684;&#x5C5E;&#x6027;&#xFF1A;<code>true</code> <code>false</code></p>
<ul>
<li><code>checked</code></li>
<li><code>selected</code></li>
<li><code>disabled</code></li>
</ul>
<p>&#x5728;jquery&#x91CC;&#x9762;&#xFF0C;&#x78B0;&#x5230;&#x5E03;&#x5C14;&#x7C7B;&#x578B;&#x7684;&#x5C5E;&#x6027;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4E0D;&#x8981;&#x7528;attr&#x65B9;&#x6CD5;&#xFF0C;&#x5E94;&#x8BE5;prop&#x65B9;&#x6CD5;</p>
<ul>
<li><code>prop(&quot;checked&quot;);</code><ul>
<li><em>&#x7528;&#x6CD5;&#x548C;css&#x7528;&#x6CD5;&#x662F;&#x4E00;&#x6837;</em></li>
</ul>
</li>
</ul>
<h3 id="jQuery&#x83B7;&#x53D6;&#x5C5E;&#x6027;&#x503C;width&#x7CFB;&#x5217;&#xFF08;&#x64CD;&#x4F5C;&#x5C3A;&#x5BF8;&#xFF09;"><a href="#jQuery&#x83B7;&#x53D6;&#x5C5E;&#x6027;&#x503C;width&#x7CFB;&#x5217;&#xFF08;&#x64CD;&#x4F5C;&#x5C3A;&#x5BF8;&#xFF09;" class="headerlink" title="jQuery&#x83B7;&#x53D6;&#x5C5E;&#x6027;&#x503C;width&#x7CFB;&#x5217;&#xFF08;&#x64CD;&#x4F5C;&#x5C3A;&#x5BF8;&#xFF09;"></a>jQuery&#x83B7;&#x53D6;&#x5C5E;&#x6027;&#x503C;width&#x7CFB;&#x5217;&#xFF08;&#x64CD;&#x4F5C;&#x5C3A;&#x5BF8;&#xFF09;</h3><ul>
<li><code>width();</code><ul>
<li><em>&#x80FD;&#x83B7;&#x53D6;&#x3001;&#x8BBE;&#x7F6E;</em></li>
</ul>
</li>
<li><code>Innerwidth();</code><ul>
<li><em>&#x83B7;&#x53D6;&#x5185;&#x90E8;&#x5BBD;&#x5EA6;&#xFF08;&#x5305;&#x62EC;&#x5BBD;&#x5EA6;&#x548C;padding&#xFF09;</em></li>
</ul>
</li>
<li><code>Outerwidth();</code><ul>
<li><em>&#x83B7;&#x53D6;&#x5185;&#x90E8;&#x5BBD;&#x5EA6;&#xFF08;&#x5305;&#x62EC;&#x5BBD;&#x5EA6;&#x548C;padding&#x548C;border&#xFF09;</em></li>
</ul>
</li>
<li><code>Outerwidth(true);</code><ul>
<li><em>&#x83B7;&#x53D6;&#x5185;&#x90E8;&#x5BBD;&#x5EA6;&#xFF08;&#x5305;&#x62EC;&#x5BBD;&#x5EA6;&#x548C;padding&#x548C;border&#x548C;margin&#xFF09;</em></li>
</ul>
</li>
<li><code>height();</code><ul>
<li><em>&#x80FD;&#x83B7;&#x53D6;&#x3001;&#x8BBE;&#x7F6E;</em></li>
</ul>
</li>
<li><code>Innerheight();</code><ul>
<li><em>&#x83B7;&#x53D6;&#x5185;&#x90E8;&#x9AD8;&#x5EA6;&#xFF08;&#x5305;&#x62EC;&#x9AD8;&#x5EA6;&#x548C; padding&#xFF09;</em></li>
</ul>
</li>
<li><code>Outerheight();</code><ul>
<li><em>&#x83B7;&#x53D6;&#x5185;&#x90E8;&#x9AD8;&#x5EA6;&#xFF08;&#x5305;&#x62EC;&#x9AD8;&#x5EA6;&#x548C; padding &#x548C; border&#xFF09;</em></li>
</ul>
</li>
<li><code>Outerheight(true);</code><ul>
<li><em>&#x83B7;&#x53D6;&#x5185;&#x90E8;&#x9AD8;&#x5EA6;&#xFF08;&#x5305;&#x62EC;&#x9AD8;&#x5EA6;&#x548C; padding &#x548C; border &#x548C; margin&#xFF09;</em></li>
</ul>
</li>
</ul>
<h3 id="jQuery&#x64CD;&#x4F5C;&#x5750;&#x6807;"><a href="#jQuery&#x64CD;&#x4F5C;&#x5750;&#x6807;" class="headerlink" title="jQuery&#x64CD;&#x4F5C;&#x5750;&#x6807;"></a>jQuery&#x64CD;&#x4F5C;&#x5750;&#x6807;</h3><ul>
<li><code>position();</code><ul>
<li><em>&#x53EA;&#x80FD;&#x83B7;&#x53D6;&#x4E0D;&#x80FD;&#x8BBE;&#x7F6E;&#xFF0C;&#x8BBE;&#x7F6E;&#x7528; css &#x8BBE;&#x7F6E;&#xFF0C;&#x627E;&#x6700;&#x8FD1;&#x7684;&#x6709;&#x76F8;&#x5BF9;&#x5B9A;&#x4F4D;&#x7684;&#x7684;&#x7236;&#x76D2;&#x5B50;</em></li>
</ul>
</li>
<li><code>offset();</code><ul>
<li><em>&#x76F8;&#x5BF9;&#x4E0E;dom&#x6700;&#x5DE6;&#x4E0A;&#x89D2;&#xFF08;&#x83B7;&#x53D6;&#x3001;&#x8BBE;&#x7F6E;&#xFF09;</em></li>
<li><em>&#x5E26;&#x6709; left &#x5C5E;&#x6027;&#x548C; top &#x5C5E;&#x6027;</em></li>
</ul>
</li>
<li><code>offsetParent()</code><ul>
<li><em>&#x6700;&#x8FD1;&#x5B9A;&#x4F4D;&#x7684;&#x7956;&#x5148;&#x5143;&#x7D20;</em></li>
</ul>
</li>
<li><code>scrollTop();</code><ul>
<li><em>&#x8BBE;&#x7F6E;&#x5377;&#x53BB;&#x7684;&#x8DDD;&#x79BB;&#xFF08;&#x4E8B;&#x4EF6;&#xFF09;</em></li>
</ul>
</li>
<li><code>scrollLeft();</code><ul>
<li><em>&#x8BBE;&#x7F6E;&#x5377;&#x53BB;&#x7684;&#x8DDD;&#x79BB;&#xFF08;&#x4E8B;&#x4EF6;&#xFF09;</em></li>
</ul>
</li>
</ul>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">$(<span class="built_in">window</span>).scroll(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{</div><div class="line">  $(<span class="keyword">this</span>).scrollTop();</div><div class="line">  $(<span class="keyword">this</span>).scrollLeft();</div><div class="line">});</div></pre></td></tr></table></figure>
<h3 id="&#x83B7;&#x53D6;&#x548C;&#x8BBE;&#x7F6E;-CSS-&#x7C7B;"><a href="#&#x83B7;&#x53D6;&#x548C;&#x8BBE;&#x7F6E;-CSS-&#x7C7B;" class="headerlink" title="&#x83B7;&#x53D6;&#x548C;&#x8BBE;&#x7F6E; CSS &#x7C7B;"></a>&#x83B7;&#x53D6;&#x548C;&#x8BBE;&#x7F6E; CSS &#x7C7B;</h3><ul>
<li><code>addClass()</code> <ul>
<li><em>&#x6DFB;&#x52A0;&#x7C7B;</em></li>
</ul>
</li>
<li><code>removeClass()</code><ul>
<li><em>&#x5220;&#x9664;&#x7C7B;</em></li>
</ul>
</li>
<li><code>toggleClass()</code><ul>
<li><em>&#x6CA1;&#x6709;&#x7C7B;&#x5219;&#x6DFB;&#x52A0;&#xFF0C;&#x5426;&#x5219;&#x5220;&#x9664;</em></li>
</ul>
</li>
<li><code>hasClass()</code><ul>
<li><em>&#x5224;&#x65AD;&#x662F;&#x5426;&#x5B58;&#x5728;</em></li>
</ul>
</li>
</ul>
<h3 id="&#x8BBE;&#x7F6E;&#x6216;&#x83B7;&#x53D6;&#x5143;&#x7D20;&#x5185;&#x5BB9;"><a href="#&#x8BBE;&#x7F6E;&#x6216;&#x83B7;&#x53D6;&#x5143;&#x7D20;&#x5185;&#x5BB9;" class="headerlink" title="&#x8BBE;&#x7F6E;&#x6216;&#x83B7;&#x53D6;&#x5143;&#x7D20;&#x5185;&#x5BB9;"></a>&#x8BBE;&#x7F6E;&#x6216;&#x83B7;&#x53D6;&#x5143;&#x7D20;&#x5185;&#x5BB9;</h3><ul>
<li><code>html()</code><ul>
<li><em>&#x4E0D;&#x4F20;&#x53C2;&#x83B7;&#x53D6;</em></li>
<li><em>&#x4F20;&#x53C2;&#x8BBE;&#x7F6E;&#x503C;&#xFF0C;html&#x683C;&#x5F0F;&#x5B57;&#x7B26;&#x4E32;</em></li>
</ul>
</li>
<li><code>text()</code><ul>
<li><em>&#x4E0D;&#x4F20;&#x53C2;&#x83B7;&#x53D6;</em></li>
<li><em>&#x4F20;&#x53C2;&#x8BBE;&#x7F6E;&#x503C;&#xFF0C;&#x7EAF;&#x6587;&#x672C;</em> </li>
</ul>
</li>
</ul>
<hr>
<h2 id="jQuery&#x4E8B;&#x4EF6;"><a href="#jQuery&#x4E8B;&#x4EF6;" class="headerlink" title="jQuery&#x4E8B;&#x4EF6;"></a>jQuery&#x4E8B;&#x4EF6;</h2><ul>
<li>&#x4E8B;&#x4EF6;&#x673A;&#x5236;&#xFF1A;<ul>
<li>&#x7528;&#x6237;&#x6267;&#x884C;&#x67D0;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#xFF0C;&#x6D4F;&#x89C8;&#x5668;&#x4F1A;&#x76F8;&#x5E94;&#x7528;&#x6237;&#x7684;&#x64CD;&#x4F5C;&#xFF0C;&#x6267;&#x884C;&#x67D0;&#x4E2A;&#x51FD;&#x6570;</li>
</ul>
</li>
<li>&#x4E8B;&#x4EF6;&#x5904;&#x7406;&#x51FD;&#x6570;&#xFF1A;<ul>
<li>&#x6240;&#x8C13;&#x7684;&#x4E8B;&#x4EF6;&#x5904;&#x7406;&#x51FD;&#x6570;&#xFF0C;&#x5C31;&#x662F;&#x54CD;&#x5E94;&#x7528;&#x6237;&#x7684;&#x90A3;&#x4E2A;&#x51FD;&#x6570;</li>
</ul>
</li>
<li>&#x7528;&#x6237;&#x4E8B;&#x4EF6;&#xFF1A;<ul>
<li>&#x5C31;&#x662F;&#x4E8B;&#x4EF6;&#x540D;&#xFF0C;&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x6CE8;&#x518C;&#x7684;&#x4E8B;&#x4EF6;</li>
</ul>
</li>
<li>&#x6CE8;&#x518C;&#x4E8B;&#x4EF6;&#xFF1A;<ul>
<li>&#x5C31;&#x662F;&#x8D4B;&#x503C;&#x6216;&#x8C03;&#x7528;addEventListener</li>
</ul>
</li>
<li>&#x54CD;&#x5E94;&#x4E8B;&#x4EF6;&#xFF1A;<ul>
<li>&#x505A;&#x5B8C;&#x64CD;&#x4F5C;&#x8C03;&#x7528;&#x67D0;&#x4E2A;&#x65B9;&#x6CD5;</li>
</ul>
</li>
</ul>
<h3 id="jQuery&#x4E8B;&#x4EF6;&#x53D1;&#x5C55;"><a href="#jQuery&#x4E8B;&#x4EF6;&#x53D1;&#x5C55;" class="headerlink" title="jQuery&#x4E8B;&#x4EF6;&#x53D1;&#x5C55;"></a>jQuery&#x4E8B;&#x4EF6;&#x53D1;&#x5C55;</h3><blockquote>
<p>&#x7B80;&#x5355;&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;&#xFF1A;&#x4E0D;&#x80FD;&#x540C;&#x65F6;&#x6CE8;&#x518C;&#x4E24;&#x4E2A;&#x4E8B;&#x4EF6;</p>
</blockquote>
<p>bind&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">$(<span class="string">&quot;p&quot;</span>).bind({</div><div class="line">   <span class="string">&quot;click&quot;</span>: <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{</div><div class="line">        alert(<span class="string">&quot;&#x6211;&#x6267;&#x884C;&#x4E86;click&quot;</span>);</div><div class="line">   },<span class="string">&quot;mouseenter&quot;</span>: <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{</div><div class="line">        alert(<span class="string">&quot;&#x6211;&#x6267;&#x884C;&#x4E86;mouseenter&quot;</span>);</div><div class="line">   }</div><div class="line">});</div></pre></td></tr></table></figure>
<p>&#x4E0D;&#x652F;&#x6301;&#x52A8;&#x6001;&#x521B;&#x5EFA;&#x5143;&#x7D20;</p>
<blockquote>
<p>delegate&#x4E8B;&#x4EF6;&#xFF08;&#x59D4;&#x6258;&#x3001;&#x59D4;&#x6D3E;&#x3001;&#x4EE3;&#x7406;&#xFF09;</p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">$(<span class="string">&quot;div&quot;</span>).delegate(<span class="string">&quot;p&quot;</span>, <span class="string">&quot;click&quot;</span>, <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{</div><div class="line">  alert(<span class="string">&quot;&#x6211;&#x6267;&#x884C;&#x4E86;&#x59D4;&#x6258;&#x4E8B;&#x4EF6;&quot;</span>);</div><div class="line">});</div></pre></td></tr></table></figure>
<h3 id="on&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;"><a href="#on&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;" class="headerlink" title="on&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;"></a>on&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="comment">/*on&#x7ED9;div&#x6CE8;&#x518C;&#x59D4;&#x6258;&#x4E8B;&#x4EF6;*/</span></div><div class="line">$(<span class="string">&quot;div&quot;</span>).on(<span class="string">&quot;click&quot;</span>, <span class="string">&quot;p&quot;</span>, <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{</div><div class="line">}); </div><div class="line"><span class="comment">/*on&#x7ED9;div&#x6CE8;&#x518C;&#x666E;&#x901A;&#x7684;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;*/</span></div><div class="line">$(<span class="string">&quot;div&quot;</span>).on(<span class="string">&quot;click&quot;</span>, <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{</div><div class="line">  alert(<span class="string">&quot;&#x6211;&#x89E6;&#x53D1;&#x4E86;div&#x672C;&#x8EAB;&#x7684;&#x4E8B;&#x4EF6;&quot;</span>);</div><div class="line">});</div></pre></td></tr></table></figure>
<h3 id="&#x89E3;&#x9664;&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;"><a href="#&#x89E3;&#x9664;&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;" class="headerlink" title="&#x89E3;&#x9664;&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;"></a>&#x89E3;&#x9664;&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="comment">/*off&#x662F;&#x89E3;&#x9664;&#x6240;&#x6709;&#x7684;&#x4E8B;&#x4EF6;,&#x80FD;&#x89E3;&#x9664;&#x59D4;&#x6258;&#x4E8B;&#x4EF6;*/</span></div><div class="line">$(<span class="string">&quot;div&quot;</span>).off();</div><div class="line"><span class="comment">/*&#x89E3;&#x9664;click&#x4E8B;&#x4EF6;*/</span></div><div class="line">$(<span class="string">&quot;div&quot;</span>).off(<span class="string">&quot;click&quot;</span>);</div><div class="line"><span class="comment">/*&#x89E3;&#x9664;&#x59D4;&#x6258;&#x7684;click&#x4E8B;&#x4EF6;*/</span></div><div class="line">$(<span class="string">&quot;div&quot;</span>).off(<span class="string">&quot;click&quot;</span>,<span class="string">&quot;**&quot;</span>);</div></pre></td></tr></table></figure>
<h3 id="&#x4E8B;&#x4EF6;&#x89E6;&#x53D1;"><a href="#&#x4E8B;&#x4EF6;&#x89E6;&#x53D1;" class="headerlink" title="&#x4E8B;&#x4EF6;&#x89E6;&#x53D1;"></a>&#x4E8B;&#x4EF6;&#x89E6;&#x53D1;</h3><ul>
<li><code>trigger(&quot;focus&quot;);</code><ul>
<li><em>&#x89E6;&#x53D1;&#x83B7;&#x53D6;&#x7126;&#x70B9;&#x4E8B;&#x4EF6;&#xFF0C;&#x4F1A;&#x89E6;&#x53D1;&#x6D4F;&#x89C8;&#x5668;&#x9ED8;&#x8BA4;&#x884C;&#x4E3A;</em></li>
</ul>
</li>
<li><code>triggerHandler(&quot;focus&quot;);</code><ul>
<li><em>&#x89E6;&#x53D1;&#x83B7;&#x53D6;&#x7126;&#x70B9;&#x4E8B;&#x4EF6;&#xFF0C;&#x4E0D;&#x4F1A;&#x89E6;&#x53D1;&#x6D4F;&#x89C8;&#x5668;&#x9ED8;&#x8BA4;&#x884C;&#x4E3A;</em></li>
</ul>
</li>
</ul>
<h3 id="&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;event"><a href="#&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;event" class="headerlink" title="&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;event"></a>&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;event</h3><ul>
<li><code>click(function(event){...});</code><ul>
<li><em>&#x70B9;&#x51FB;</em></li>
</ul>
</li>
<li><code>keyCode = event.keyCode;</code><ul>
<li><em>&#x952E;&#x76D8;&#x7801;</em></li>
</ul>
</li>
</ul>
<h3 id="&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;"><a href="#&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;" class="headerlink" title="&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;"></a>&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;</h3><p>&#x65B9;&#x6CD5;1&#xFF1A; </p>
<ul>
<li><code>event.stopPropagation();</code></li>
</ul>
<p>&#x65B9;&#x6CD5;2&#xFF1A; </p>
<ul>
<li><code>return false;</code></li>
</ul>
<h3 id="&#x963B;&#x6B62;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x9ED8;&#x8BA4;&#x884C;&#x4E3A;"><a href="#&#x963B;&#x6B62;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x9ED8;&#x8BA4;&#x884C;&#x4E3A;" class="headerlink" title="&#x963B;&#x6B62;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x9ED8;&#x8BA4;&#x884C;&#x4E3A;"></a>&#x963B;&#x6B62;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x9ED8;&#x8BA4;&#x884C;&#x4E3A;</h3><p>&#x65B9;&#x6CD5;1&#xFF1A;</p>
<ul>
<li><code>event.preventDefault();</code></li>
</ul>
<p>&#x65B9;&#x6CD5;2&#xFF1A;</p>
<ul>
<li><code>return false;</code></li>
</ul>
<h3 id="&#x4E8B;&#x4EF6;"><a href="#&#x4E8B;&#x4EF6;" class="headerlink" title="&#x4E8B;&#x4EF6;"></a>&#x4E8B;&#x4EF6;</h3><ul>
<li><code>click(function(){...});</code><ul>
<li><em>&#x70B9;&#x51FB;</em></li>
</ul>
</li>
<li><code>scroll(function(){...});</code><ul>
<li><em>&#x9F20;&#x6807;&#x6EDA;&#x8F6E;&#x4E8B;&#x4EF6;</em></li>
</ul>
</li>
<li><code>focus(function(){...});</code><ul>
<li><em>&#x83B7;&#x53D6;&#x7126;&#x70B9;</em></li>
</ul>
</li>
<li><code>mouseenter(function(){...});</code><ul>
<li><em>&#x9F20;&#x6807;&#x7ECF;&#x8FC7;</em></li>
</ul>
</li>
<li><code>mouseleave(function(){...});</code><ul>
<li><em>&#x9F20;&#x6807;&#x79BB;&#x5F00;</em></li>
</ul>
</li>
<li><code>keydown(function(event){var keyCode = event.keyCode;});</code><ul>
<li><em>&#x952E;&#x76D8;&#x6309;&#x952E;&#x6309;&#x4E0B;</em></li>
</ul>
</li>
<li><code>keyup(function(event){var keyCode = event.keyCode;});</code><ul>
<li><em>&#x952E;&#x76D8;&#x62AC;&#x8D77;</em></li>
</ul>
</li>
</ul>
<h3 id="&#x6D4F;&#x89C8;&#x5668;&#x63D0;&#x4F9B;&#x7684;&#x4E8B;&#x4EF6;"><a href="#&#x6D4F;&#x89C8;&#x5668;&#x63D0;&#x4F9B;&#x7684;&#x4E8B;&#x4EF6;" class="headerlink" title="&#x6D4F;&#x89C8;&#x5668;&#x63D0;&#x4F9B;&#x7684;&#x4E8B;&#x4EF6;"></a>&#x6D4F;&#x89C8;&#x5668;&#x63D0;&#x4F9B;&#x7684;&#x4E8B;&#x4EF6;</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div></pre></td><td class="code"><pre><div class="line">&quot;onabort&quot;, &quot;onblur&quot;, &quot;oncancel&quot;, &quot;oncanplay&quot;, </div><div class="line">&quot;oncanplaythrough&quot;, &quot;onchange&quot;, &quot;onclick&quot;, &quot;onclose&quot;,</div><div class="line">&quot;oncontextmenu&quot;, &quot;oncuechange&quot;, &quot;ondblclick&quot;, &quot;ondrag&quot;, </div><div class="line">&quot;ondragend&quot;, &quot;ondragenter&quot;, &quot;ondragleave&quot;, &quot;ondragover&quot;,</div><div class="line">&quot;ondragstart&quot;, &quot;ondrop&quot;, &quot;ondurationchange&quot;, &quot;onemptied&quot;,</div><div class="line">&quot;onended&quot;, &quot;onerror&quot;, &quot;onfocus&quot;, &quot;oninput&quot;, &quot;oninvalid&quot;, </div><div class="line">&quot;onkeydown&quot;, &quot;onkeypress&quot;, &quot;onkeyup&quot;, &quot;onload&quot;,</div><div class="line">&quot;onloadeddata&quot;, &quot;onloadedmetadata&quot;, &quot;onloadstart&quot;, &quot;onmousedown&quot;, </div><div class="line">&quot;onmouseenter&quot;, &quot;onmouseleave&quot;, &quot;onmousemove&quot;, &quot;onmouseout&quot;, </div><div class="line">&quot;onmouseover&quot;, &quot;onmouseup&quot;, &quot;onmousewheel&quot;, &quot;onpause&quot;, </div><div class="line">&quot;onplay&quot;, &quot;onplaying&quot;, &quot;onprogress&quot;, &quot;onratechange&quot;, </div><div class="line">&quot;onreset&quot;, &quot;onresize&quot;, &quot;onscroll&quot;, &quot;onseeked&quot;, </div><div class="line">&quot;onseeking&quot;, &quot;onselect&quot;, &quot;onshow&quot;, &quot;onstalled&quot;, </div><div class="line">&quot;onsubmit&quot;, &quot;onsuspend&quot;, &quot;ontimeupdate&quot;, &quot;ontoggle&quot;, </div><div class="line">&quot;onvolumechange&quot;, &quot;onwaiting&quot;, &quot;onbeforecopy&quot;, &quot;onbeforecut&quot;, </div><div class="line">&quot;onbeforepaste&quot;, &quot;oncopy&quot;, &quot;oncut&quot;, &quot;onpaste&quot;, </div><div class="line">&quot;onsearch&quot;, &quot;onselectstart&quot;, &quot;onwheel&quot;, &quot;onwebkitfullscreenchange&quot;, </div><div class="line">&quot;onwebkitfullscreenerror&quot;</div></pre></td></tr></table></figure>
<hr>
<h2 id="&#x8FED;&#x4EE3;"><a href="#&#x8FED;&#x4EE3;" class="headerlink" title="&#x8FED;&#x4EE3;"></a>&#x8FED;&#x4EE3;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="comment">/*&#x663E;&#x5F0F;&#x8FED;&#x4EE3;&#xFF1A;&#x5BF9;&#x6BCF;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x505A;&#x4E0D;&#x540C;&#x7684;&#x5904;&#x7406;*/</span></div><div class="line"><span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; $(<span class="string">&quot;li&quot;</span>).length; i++) {</div><div class="line">  <span class="keyword">var</span> target = (i + <span class="number">1</span>) / <span class="number">10</span>;</div><div class="line">  $(<span class="string">&quot;li&quot;</span>).eq(i).css(<span class="string">&quot;opacity&quot;</span>, target);</div><div class="line">}</div><div class="line"><span class="comment">/*each();*/</span></div><div class="line">$(<span class="string">&quot;li&quot;</span>).each(<span class="function"><span class="keyword">function</span> (<span class="params">index, element</span>) </span>{</div><div class="line">  <span class="keyword">var</span> target = (index + <span class="number">1</span>) / <span class="number">10</span>;</div><div class="line">  $(element).css(<span class="string">&quot;opacity&quot;</span>, target);</div><div class="line">});</div></pre></td></tr></table></figure>
<hr>
<h2 id="&#x63D2;&#x4EF6;"><a href="#&#x63D2;&#x4EF6;" class="headerlink" title="&#x63D2;&#x4EF6;"></a>&#x63D2;&#x4EF6;</h2><h3 id="&#x61D2;&#x52A0;&#x8F7D;&#x63D2;&#x4EF6;"><a href="#&#x61D2;&#x52A0;&#x8F7D;&#x63D2;&#x4EF6;" class="headerlink" title="&#x61D2;&#x52A0;&#x8F7D;&#x63D2;&#x4EF6;"></a>&#x61D2;&#x52A0;&#x8F7D;&#x63D2;&#x4EF6;</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">img</span> <span class="attr">class</span>=<span class="string">&quot;lazy&quot;</span> <span class="attr">data-original</span>=<span class="string">&quot;23.jpg&quot;</span> <span class="attr">alt</span>=<span class="string">&quot;&quot;</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;jquery-1.12.4.js&quot;</span> <span class="attr">type</span>=<span class="string">&quot;text/javascript&quot;</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;plugins/jquery.lazyload.js&quot;</span> <span class="attr">type</span>=<span class="string">&quot;text/javascript&quot;</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">    $(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{$(<span class="string">&quot;img.lazy&quot;</span>).lazyload();});</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<h3 id="fullpage&#x63D2;&#x4EF6;"><a href="#fullpage&#x63D2;&#x4EF6;" class="headerlink" title="fullpage&#x63D2;&#x4EF6;"></a>fullpage&#x63D2;&#x4EF6;</h3><h4 id="&#x5F15;&#x5165;&#x6587;&#x4EF6;"><a href="#&#x5F15;&#x5165;&#x6587;&#x4EF6;" class="headerlink" title="&#x5F15;&#x5165;&#x6587;&#x4EF6;"></a>&#x5F15;&#x5165;&#x6587;&#x4EF6;</h4><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">rel</span>=<span class="string">&quot;stylesheet&quot;</span> <span class="attr">href</span>=<span class="string">&quot;css/jquery.fullPage.css&quot;</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;js/jquery.min.js&quot;</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;js/jquery-ui.min.js&quot;</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;js/jquery.fullPage.js&quot;</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<h4 id="html"><a href="#html" class="headerlink" title="html"></a>html</h4><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;fullpage&quot;</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;section&quot;</span>&gt;</span>&#x7B2C;&#x4E00;&#x5C4F;<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;section&quot;</span>&gt;</span>&#x7B2C;&#x4E8C;&#x5C4F;<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;section&quot;</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;slide&quot;</span>&gt;</span>&#x7B2C;&#x4E09;&#x5C4F;&#x7684;&#x7B2C;&#x4E00;&#x5C4F;<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;slide&quot;</span>&gt;</span>&#x7B2C;&#x4E09;&#x5C4F;&#x7684;&#x7B2C;&#x4E8C;&#x5C4F;<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;slide&quot;</span>&gt;</span>&#x7B2C;&#x4E09;&#x5C4F;&#x7684;&#x7B2C;&#x4E09;&#x5C4F;<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;slide&quot;</span>&gt;</span>&#x7B2C;&#x4E09;&#x5C4F;&#x7684;&#x7B2C;&#x56DB;&#x5C4F;<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;section&quot;</span>&gt;</span>&#x7B2C;&#x56DB;&#x5C4F;<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div></pre></td></tr></table></figure>
<h4 id="js"><a href="#js" class="headerlink" title="js"></a>js</h4><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line">$(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">  $(<span class="string">&apos;#fullpage&apos;</span>).fullpage({</div><div class="line">    <span class="string">&apos;verticalCentered&apos;</span>: <span class="literal">false</span>,</div><div class="line">    <span class="string">&apos;css3&apos;</span>: <span class="literal">true</span>,</div><div class="line">    <span class="string">&apos;sectionsColor&apos;</span>: [<span class="string">&apos;#254875&apos;</span>, <span class="string">&apos;#00FF00&apos;</span>, <span class="string">&apos;#254587&apos;</span>, <span class="string">&apos;#695684&apos;</span>],</div><div class="line">    <span class="attr">anchors</span>: [<span class="string">&apos;page1&apos;</span>, <span class="string">&apos;page2&apos;</span>, <span class="string">&apos;page3&apos;</span>, <span class="string">&apos;page4&apos;</span>],</div><div class="line">    <span class="string">&apos;navigation&apos;</span>: <span class="literal">true</span>,</div><div class="line">    <span class="string">&apos;navigationPosition&apos;</span>: <span class="string">&apos;right&apos;</span>,</div><div class="line">    <span class="string">&apos;navigationTooltips&apos;</span>: [<span class="string">&apos;fullPage.js&apos;</span>, <span class="string">&apos;Powerful&apos;</span>, <span class="string">&apos;Amazing&apos;</span>, <span class="string">&apos;Simple&apos;</span>]</div><div class="line">  });</div><div class="line">});</div></pre></td></tr></table></figure>
<h4 id="&#x53EF;&#x9009;&#x914D;&#x7F6E;"><a href="#&#x53EF;&#x9009;&#x914D;&#x7F6E;" class="headerlink" title="&#x53EF;&#x9009;&#x914D;&#x7F6E;"></a>&#x53EF;&#x9009;&#x914D;&#x7F6E;</h4><ul>
<li>&#x9009;&#x9879;</li>
<li>&#x65B9;&#x6CD5;</li>
<li>&#x56DE;&#x8C03;&#x51FD;&#x6570;</li>
</ul>
<h3 id="jqueryUI&#x63D2;&#x4EF6;"><a href="#jqueryUI&#x63D2;&#x4EF6;" class="headerlink" title="jqueryUI&#x63D2;&#x4EF6;"></a>jqueryUI&#x63D2;&#x4EF6;</h3><p><a href="http://jqueryui.com/" target="_blank" rel="external">jqueryUI&#x63D2;&#x4EF6; &#x5B98;&#x7F51;</a></p>
<h4 id="&#x5F15;&#x5165;&#x6587;&#x4EF6;-1"><a href="#&#x5F15;&#x5165;&#x6587;&#x4EF6;-1" class="headerlink" title="&#x5F15;&#x5165;&#x6587;&#x4EF6;"></a>&#x5F15;&#x5165;&#x6587;&#x4EF6;</h4><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">rel</span>=<span class="string">&quot;stylesheet&quot;</span> <span class="attr">href</span>=<span class="string">&quot;plugins/jquery-ui.css&quot;</span> /&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;jquery-1.12.4.js&quot;</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;plugins/jquery-ui.js&quot;</span>&gt;</span><span class="undefined"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<h4 id="html-1"><a href="#html-1" class="headerlink" title="html"></a>html</h4><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;drag-wrapper&quot;</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;drag-bar&quot;</span>&gt;</span>&#x53EF;&#x62D6;&#x52A8;&#x3001;&#x6392;&#x5E8F;&#x3001;&#x53D8;&#x5F62;&#x7684;&#x65B0;&#x95FB;&#x6A21;&#x5757;<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;resize-item&quot;</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;sort-wrapper&quot;</span>&gt;</span></div><div class="line">            <span class="tag">&lt;<span class="name">ul</span> <span class="attr">class</span>=<span class="string">&quot;sort-item&quot;</span>&gt;</span></div><div class="line">                <span class="tag">&lt;<span class="name">li</span>&gt;</span>&#x8FD9;&#x662F;&#x7B2C;1&#x6761;&#x65B0;&#x95FB;!<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">                <span class="tag">&lt;<span class="name">li</span>&gt;</span>&#x8FD9;&#x662F;&#x7B2C;2&#x6761;&#x65B0;&#x95FB;!<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">                <span class="tag">&lt;<span class="name">li</span>&gt;</span>&#x8FD9;&#x662F;&#x7B2C;3&#x6761;&#x65B0;&#x95FB;!<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">            <span class="tag">&lt;/<span class="name">ul</span>&gt;</span></div><div class="line">        <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></div></pre></td></tr></table></figure>
<h4 id="js-1"><a href="#js-1" class="headerlink" title="js"></a>js</h4><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">    $(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{</div><div class="line">        $(<span class="string">&quot;.drag-wrapper&quot;</span>).draggable({<span class="string">&quot;handle&quot;</span>:<span class="string">&quot;.drag-bar&quot;</span>});</div><div class="line">        $(<span class="string">&quot;.resize-item&quot;</span>).resizable({<span class="string">&quot;handles&quot;</span>:<span class="string">&quot;s&quot;</span>});</div><div class="line">        $(<span class="string">&quot;.sort-item&quot;</span>).sortable({<span class="string">&quot;opacity&quot;</span>:<span class="string">&quot;0.5&quot;</span>});</div><div class="line">    });</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<h3 id="&#x63D2;&#x4EF6;&#x5236;&#x4F5C;"><a href="#&#x63D2;&#x4EF6;&#x5236;&#x4F5C;" class="headerlink" title="&#x63D2;&#x4EF6;&#x5236;&#x4F5C;"></a>&#x63D2;&#x4EF6;&#x5236;&#x4F5C;</h3><p>&#x5236;&#x4F5C;&#x63D2;&#x4EF6;&#xFF1A;&#x5C31;&#x662F;&#x7ED9;jquery&#x5BF9;&#x8C61;&#x6DFB;&#x52A0;&#x65B9;&#x6CD5;&#x3002;</p>
<ul>
<li><code>$.fn.fnName = function(){}</code></li>
</ul>
<hr>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>感谢您的支持！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>打 赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="http://ofy7k3v4s.bkt.clouddn.com/wcpayCode.jpg" alt="Hongqin Ma WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="http://ofy7k3v4s.bkt.clouddn.com/apayCode.jpg" alt="Hongqin Ma Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/jQuery/" rel="tag">#jQuery</a>
          
            <a href="/tags/库/" rel="tag">#库</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2014/11/18/20-canvas/" rel="next" title="canvas">
                <i class="fa fa-chevron-left"></i> canvas
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2014/12/17/22-JSON/" rel="prev" title="JSON 数据">
                JSON 数据 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2014/12/05/21-jQuery/"
     data-title="jQuery"
     data-content=""
     data-url="https://hongqinma.github.io/2014/12/05/21-jQuery/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2014/12/05/21-jQuery/"
           data-title="jQuery" data-url="https://hongqinma.github.io/2014/12/05/21-jQuery/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="//schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/photo.jpg"
               alt="Hongqin Ma" />
          <p class="site-author-name" itemprop="name">Hongqin Ma</p>
          <p class="site-description motion-element" itemprop="description">Spell at all costs， to rush you in the future. </p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">68</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">16</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">57</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/HongqinMa" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/HongqinMa" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.facebook.com/profile.php?id=100006581058735" target="_blank" title="Facebook">
                  
                    <i class="fa fa-fw fa-facebook"></i>
                  
                  Facebook
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/HirakuMa" target="_blank" title="知乎">
                  
                    <i class="fa fa-fw fa-share-alt"></i>
                  
                  知乎
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/rubylouvre/" title="司徒正美" target="_blank">司徒正美</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/sanshi/" title="三生石上" target="_blank">三生石上</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/TomXu/" title="汤姆大叔" target="_blank">汤姆大叔</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://gold.xitu.io/" title="掘金" target="_blank">掘金</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://segmentfault.com/" title="segmentfault" target="_blank">segmentfault</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jianshu.com/users/1cbb94e5ed4d/latest_articles" title="简书" target="_blank">简书</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://home.cnblogs.com/" title="博客园" target="_blank">博客园</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.awesomes.cn/" title="Awesomes" target="_blank">Awesomes</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#jQuery前戏"><span class="nav-number">1.</span> <span class="nav-text">jQuery前戏</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#js不足"><span class="nav-number">1.1.</span> <span class="nav-text">js不足</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#什么是jquery？"><span class="nav-number">1.2.</span> <span class="nav-text">什么是jquery？</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#引包"><span class="nav-number">1.3.</span> <span class="nav-text">引包</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#全局函数"><span class="nav-number">2.</span> <span class="nav-text">全局函数</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#入口函数"><span class="nav-number">2.1.</span> <span class="nav-text">入口函数</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#js入口函数"><span class="nav-number">2.1.1.</span> <span class="nav-text">js入口函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#jQuery入口函数1"><span class="nav-number">2.1.2.</span> <span class="nav-text">jQuery入口函数1</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#jQuery入口函数2（简化）"><span class="nav-number">2.1.3.</span> <span class="nav-text">jQuery入口函数2（简化）</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#符实质"><span class="nav-number">2.2.</span> <span class="nav-text">$符实质</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#一些基础方法"><span class="nav-number">3.</span> <span class="nav-text">一些基础方法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#选择器"><span class="nav-number">4.</span> <span class="nav-text">选择器</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#基本选择器"><span class="nav-number">4.1.</span> <span class="nav-text">基本选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#层级选择器"><span class="nav-number">4.2.</span> <span class="nav-text">层级选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#过滤选择器"><span class="nav-number">4.3.</span> <span class="nav-text">过滤选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#方法"><span class="nav-number">4.4.</span> <span class="nav-text">方法</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#隐式迭代"><span class="nav-number">5.</span> <span class="nav-text">隐式迭代</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#类操作"><span class="nav-number">6.</span> <span class="nav-text">类操作</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#动画"><span class="nav-number">7.</span> <span class="nav-text">动画</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#淡入、淡出"><span class="nav-number">7.1.</span> <span class="nav-text">淡入、淡出</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#滑入、滑出"><span class="nav-number">7.2.</span> <span class="nav-text">滑入、滑出</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#自定义动画"><span class="nav-number">7.3.</span> <span class="nav-text">自定义动画</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#停止动画-stop"><span class="nav-number">7.4.</span> <span class="nav-text">停止动画 stop();</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jQuery和js节点操作"><span class="nav-number">8.</span> <span class="nav-text">jQuery和js节点操作</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#js节点操作"><span class="nav-number">8.1.</span> <span class="nav-text">js节点操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#jQuery-操作"><span class="nav-number">8.2.</span> <span class="nav-text">jQuery 操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#jQuery属性操作"><span class="nav-number">8.3.</span> <span class="nav-text">jQuery属性操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#jQuery属性操作特例"><span class="nav-number">8.4.</span> <span class="nav-text">jQuery属性操作特例</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#jQuery获取属性值width系列（操作尺寸）"><span class="nav-number">8.5.</span> <span class="nav-text">jQuery获取属性值width系列（操作尺寸）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#jQuery操作坐标"><span class="nav-number">8.6.</span> <span class="nav-text">jQuery操作坐标</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#获取和设置-CSS-类"><span class="nav-number">8.7.</span> <span class="nav-text">获取和设置 CSS 类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置或获取元素内容"><span class="nav-number">8.8.</span> <span class="nav-text">设置或获取元素内容</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jQuery事件"><span class="nav-number">9.</span> <span class="nav-text">jQuery事件</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#jQuery事件发展"><span class="nav-number">9.1.</span> <span class="nav-text">jQuery事件发展</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#on事件绑定"><span class="nav-number">9.2.</span> <span class="nav-text">on事件绑定</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#解除事件绑定"><span class="nav-number">9.3.</span> <span class="nav-text">解除事件绑定</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#事件触发"><span class="nav-number">9.4.</span> <span class="nav-text">事件触发</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#事件对象event"><span class="nav-number">9.5.</span> <span class="nav-text">事件对象event</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#阻止事件冒泡"><span class="nav-number">9.6.</span> <span class="nav-text">阻止事件冒泡</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#阻止浏览器的默认行为"><span class="nav-number">9.7.</span> <span class="nav-text">阻止浏览器的默认行为</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#事件"><span class="nav-number">9.8.</span> <span class="nav-text">事件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#浏览器提供的事件"><span class="nav-number">9.9.</span> <span class="nav-text">浏览器提供的事件</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#迭代"><span class="nav-number">10.</span> <span class="nav-text">迭代</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#插件"><span class="nav-number">11.</span> <span class="nav-text">插件</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#懒加载插件"><span class="nav-number">11.1.</span> <span class="nav-text">懒加载插件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#fullpage插件"><span class="nav-number">11.2.</span> <span class="nav-text">fullpage插件</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#引入文件"><span class="nav-number">11.2.1.</span> <span class="nav-text">引入文件</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#html"><span class="nav-number">11.2.2.</span> <span class="nav-text">html</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#js"><span class="nav-number">11.2.3.</span> <span class="nav-text">js</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#可选配置"><span class="nav-number">11.2.4.</span> <span class="nav-text">可选配置</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#jqueryUI插件"><span class="nav-number">11.3.</span> <span class="nav-text">jqueryUI插件</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#引入文件-1"><span class="nav-number">11.3.1.</span> <span class="nav-text">引入文件</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#html-1"><span class="nav-number">11.3.2.</span> <span class="nav-text">html</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#js-1"><span class="nav-number">11.3.3.</span> <span class="nav-text">js</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#插件制作"><span class="nav-number">11.4.</span> <span class="nav-text">插件制作</span></a></li></ol></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hongqin Ma</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv">
    &nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Page Views: <span id="busuanzi_value_site_pv"></span> 
</span>

        

<div class="busuanzi-count">

  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span></span>
  

  
    <span class="site-pv"><i class="fa fa-eye"></i><span class="busuanzi-value" id="busuanzi_value_site_pv"></span></span>
  
  
</div>



        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.2"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.2"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"Hiraku"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  

  

  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  
  
  <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
<script>
function showTime(Counter) {
  var query = new AV.Query(Counter);
  $(".leancloud_visitors").each(function() {
    var url = $(this).attr("id").trim();
    query.equalTo("url", url);
    query.find({
      success: function(results) {
        if (results.length == 0) {
          var content = '0 ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
          return;
        }
        for (var i = 0; i < results.length; i++) {
          var object = results[i];
          var content = object.get('time') + ' ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
        }
      },
      error: function(object, error) {
        console.log("Error: " + error.code + " " + error.message);
      }
    });

  });
}

function addCount(Counter) {
  var Counter = AV.Object.extend("Counter");
  url = $(".leancloud_visitors").attr('id').trim();
  title = $(".leancloud_visitors").attr('data-flag-title').trim();
  var query = new AV.Query(Counter);
  query.equalTo("url", url);
  query.find({
    success: function(results) {
      if (results.length > 0) {
        var counter = results[0];
        counter.fetchWhenSave(true);
        counter.increment("time");
        counter.save(null, {
          success: function(counter) {
            var content =  counter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(counter, error) {
            console.log('Failed to save Visitor num, with error message: ' + error.message);
          }
        });
      } else {
        var newcounter = new Counter();
        newcounter.set("title", title);
        newcounter.set("url", url);
        newcounter.set("time", 1);
        newcounter.save(null, {
          success: function(newcounter) {
              console.log("newcounter.get('time')="+newcounter.get('time'));
            var content = newcounter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(newcounter, error) {
            console.log('Failed to create');
          }
        });
      }
    },
    error: function(error) {
      console.log('Error:' + error.code + " " + error.message);
    }
  });
}
$(function() {
  var Counter = AV.Object.extend("Counter");
  if ($('.leancloud_visitors').length == 1) {
    addCount(Counter);
  } else if ($('.post-title-link').length > 1) {
    showTime(Counter);
  }
}); 
</script>

  
</body>
</html>
